package Task1;

import java.util.ArrayList;

public class Queue {

	// TODO: [VY] minor issue, but it'll be better to rename to emailList
	private ArrayList<Email> arrayEmail = new ArrayList<>();

	public Queue(ArrayList<Email> arrayEmail) {
		this.arrayEmail = arrayEmail;
	}

	public ArrayList<Email> getArrayEmail() {
		return arrayEmail;
	}

	public Email getEmail() {
		// TODO: [VY] try to test this code in case of arrayEmail.size() == 0
		return arrayEmail.get(0);
	}

	public synchronized void addEmail(Email email) {
		arrayEmail.add(email);
	}

	public synchronized void removeEmail() {
		// TODO: [VY] try to test this code in case of arrayEmail.size() == 0
		arrayEmail.remove(0);

	}
}
